#include<stdio.h>
#include<string.h>
int main()
{
    int length(char *p);
    char str[100];
    int len;
    printf("input string: ");
    gets(str);
    len=length(str);
    printf("the length of the string is %d",len);
}
int length(char *p)
{
    int n=0;
    while(*p!='\0')
    {
        n++;
        p++;
    }
    return (n);
}